/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package wudt;

import java.io.Serializable;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;

/**
 *
 * @author Jadalbert
 */
@ManagedBean
@ViewScoped
public class FlatGasket extends Gasket implements Serializable {

    /**
     * - uszczelki płaskie
     * - wielokrawędziowe nie liczone z liczby zębów
     * - spiralne
     */
    public FlatGasket() { 
    }
       
    // geometria uszczelki
    private double u;
    private double ucz;
    private double du;
    
    /**
     * @return the U
     */
    @Override    
    public double getU() {
        return to.round(0.5 * (dz - dw), 2);
    }

    /**
     * @return the Ucz
     */
    @Override
    public double getUcz() {
        double u_ = getU();
        if (u_ <= 12) {
            return to.round(u_, 2);
        }
        else {
            return to.round(3.47 * Math.sqrt(u_),2);
        }
    }

    /**
     * @return the Du
     */
    @Override
    public double getDu() {
        return to.round(0.5 * (dw + dz),2);
    }
}